package com.atguigu.lease.web.admin.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * projectName: com.atguigu.lease.web.admin.task
 *
 * @author: wangs
 * description: springboot，配置测试定时任务
 */

//@Component
public class SpringTaskTest {

    // 每隔三秒，打印一次，现在时间
    @Scheduled(cron = "0/3 * * * * *")
    public void printDate(){
        System.out.println("new Date() = " + new Date());
    }
}
